import request from '@/utils/request'

const api = {}

//页面左边 选项数据
api.getTitleList = () => {
	return [{
		title:"订单主表报表同步",index:1
	},{
		title:"订单明细报表同步",index:2
	},{
		title:"同步商品到ES",index:3
	},{
		title:"订单服务MQ消息同步",index:4
	},{
		title:"日志服务MQ消息同步",index:5
	}]
}

//同步订单主表
api.syncOrderReport = (startDate, endDate) => {
	return request({
    	url: `/log/reportOrder/syncByDay?startDay=${startDate}&endDay=${endDate}`,
      	method: 'get'
    })
}

//同步订单明细主表
api.syncOrderDetailReport = (startDate, endDate) => {
	return request({
    	url: `/log/reportOrderdetail/syncByDay?startDay=${startDate}&endDay=${endDate}`,
      	method: 'get'
    })
}

//同步es商品
api.syncES = (data) => {
	return request({
    	url: `/goods/sync/syncToEs`,
      	method: 'post',
      	data
    })
}

//订单服务MQ消息同步
api.redoOrderMg = msgType => {
	return request({
    	url: `/order/test/redoLogMg?msgType=${msgType}`,
      	method: 'get'
    })
}

//日志服务MQ消息同步
api.redoLogMg = msgType => {
	return request({
    	url: `/log/test/redoLogMg?msgType=${msgType}`,
      	method: 'get'
    })
}
  
export default api